home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-12 | 4.7 KB | 163 lines | [TEXT/PJMM] |
- unit QuickdrawText;
-
- { Pascal Interface to the Macintosh Libraries }
-
- { Copyright © Apple Computer Inc. }
- { All Rights Reserved }
-
- { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
-
- interface
- uses
- Types;
-
- const
-
- { CharToPixel directions }
- leftCaret = 0; {Place caret for left block}
- rightCaret = -1; {Place caret for right block}
- hilite = 1; {Direction is SysDirection}
- smLeftCaret = 0; {Place caret for left block - obsolete }
- smRightCaret = -1; {Place caret for right block - obsolete }
- smHilite = 1; {Direction is TESysJust - obsolete }
- {Constants for styleRunPosition argument in PortionLine, DrawJustified,}
- { MeasureJustified, CharToPixel, and PixelToChar.}
- onlyStyleRun = 0; { This is the only style run on the line }
- leftStyleRun = 1; { This is leftmost of multiple style runs on the line }
- rightStyleRun = 2; { This is rightmost of multiple style runs on the line }
- middleStyleRun = 3; { There are multiple style runs on the line and this }
- { is neither the leftmost nor the rightmost. }
- smOnlyStyleRun = 0; { obsolete }
- smLeftStyleRun = 1; { obsolete }
- smRightStyleRun = 2; { obsolete }
- smMiddleStyleRun = 3; { obsolete }
-
- { type for styleRunPosition parameter in PixelToChar etc. }
-
- type
- JustStyleCode = INTEGER;
-
- FormatOrder = array[0..0] of INTEGER;
-
- FormatOrderPtr = ^FormatOrder;
-
- FormatStatus = INTEGER;
-
- OffPair = record
- offFirst: INTEGER;
- offSecond: INTEGER;
- end;
- OffsetTable = array[0..2] of OffPair;
-
- StyleRunDirectionProcPtr = ProcPtr; { FUNCTION StyleRunDirection(styleRunIndex: INTEGER; dirParam: UNIV Ptr): BOOLEAN; }
- StyleRunDirectionUPP = UniversalProcPtr;
-
- const
- uppStyleRunDirectionProcInfo = $00000390; { FUNCTION (2 byte param, 4 byte param): 1 byte result; }
-
- function NewStyleRunDirectionProc (userRoutine: StyleRunDirectionProcPtr): StyleRunDirectionUPP;
- inline
- $2E9F;
-
- function CallStyleRunDirectionProc (styleRunIndex: INTEGER;
- dirParam: univ Ptr;
- userRoutine: StyleRunDirectionUPP): BOOLEAN;
- inline
- $205F, $4E90;
-
- function Pixel2Char (textBuf: Ptr;
- textLen: INTEGER;
- slop: INTEGER;
- pixelWidth: INTEGER;
- var leadingEdge: BOOLEAN): INTEGER;
- inline
- $2F3C, $820E, $0014, $A8B5;
- function Char2Pixel (textBuf: Ptr;
- textLen: INTEGER;
- slop: INTEGER;
- offset: INTEGER;
- direction: INTEGER): INTEGER;
- inline
- $2F3C, $820C, $0016, $A8B5;
- function PixelToChar (textBuf: Ptr;
- textLength: LONGINT;
- slop: Fixed;
- pixelWidth: Fixed;
- var leadingEdge: BOOLEAN;
- var widthRemaining: Fixed;
- styleRunPosition: JustStyleCode;
- numer: Point;
- denom: Point): INTEGER;
- inline
- $2F3C, $8222, $002E, $A8B5;
- function CharToPixel (textBuf: Ptr;
- textLength: LONGINT;
- slop: Fixed;
- offset: LONGINT;
- direction: INTEGER;
- styleRunPosition: JustStyleCode;
- numer: Point;
- denom: Point): INTEGER;
- inline
- $2F3C, $821C, $0030, $A8B5;
- procedure DrawJustified (textPtr: Ptr;
- textLength: LONGINT;
- slop: Fixed;
- styleRunPosition: JustStyleCode;
- numer: Point;
- denom: Point);
- inline
- $2F3C, $8016, $0032, $A8B5;
- procedure MeasureJustified (textPtr: Ptr;
- textLength: LONGINT;
- slop: Fixed;
- charLocs: Ptr;
- styleRunPosition: JustStyleCode;
- numer: Point;
- denom: Point);
- inline
- $2F3C, $801A, $0034, $A8B5;
- function PortionLine (textPtr: Ptr;
- textLen: LONGINT;
- styleRunPosition: JustStyleCode;
- numer: Point;
- denom: Point): Fixed;
- inline
- $2F3C, $8412, $0036, $A8B5;
- procedure HiliteText (textPtr: Ptr;
- textLength: INTEGER;
- firstOffset: INTEGER;
- secondOffset: INTEGER;
- var offsets: OffsetTable);
- inline
- $2F3C, $800E, $001C, $A8B5;
- procedure DrawJust (textPtr: Ptr;
- textLength: INTEGER;
- slop: INTEGER);
- inline
- $2F3C, $8008, $001E, $A8B5;
- procedure MeasureJust (textPtr: Ptr;
- textLength: INTEGER;
- slop: INTEGER;
- charLocs: Ptr);
- inline
- $2F3C, $800C, $0020, $A8B5;
- function PortionText (textPtr: Ptr;
- textLength: LONGINT): Fixed;
- inline
- $2F3C, $8408, $0024, $A8B5;
- function VisibleLength (textPtr: Ptr;
- textLength: LONGINT): LONGINT;
- inline
- $2F3C, $8408, $0028, $A8B5;
- procedure GetFormatOrder (ordering: FormatOrderPtr;
- firstFormat: INTEGER;
- lastFormat: INTEGER;
- lineRight: BOOLEAN;
- rlDirProc: StyleRunDirectionUPP;
- dirParam: Ptr);
- inline
- $2F3C, $8012, $FFFC, $A8B5;
-
- implementation
- end.